var app = new Vue({
  el: ".transactions",
  data() {
    return {
      presentation: 0, //切换币种提现
      coinbalcaasdas: "",
      modify: "修改",
      Setup: "设置",
      confirm: "确认",
      cancel: "取消",
      despositadress: 0, //切换币种变量
      coinAdress: "", //充值地址
      coinAdress0: "0x8E7FE6dB2b28B56fD9663094495452aF4eE50f6F",
      typeList: 0, //充值提现转账类型
      HPS: "HPS",
      ETH: "ETH",
      BTC: "BTC",
      HSR: "HSR",
      HAND: "HAND",
      HART: "HART",
      MOT: "MOT",
      Prohibited: false, //禁用按钮多次点击
      presentation1: 0, //切换币种转账
      coinbalcaasdas1: 0,
      transferAmount: 0,
      Email: null,
      emaill: "",
      TransferuserID: 0,
      Requestuser: null,
      maskfalse:false,
      theuser:'',
      information:'',
      userid:'',
      changeaddress:false,
      withdrawaddress0:'',
      withdrawaddress1:'',
      withdrawaddress2:'',
      withdrawaddress3:'',
      withdrawaddress4:'',
      withdrawaddress5:'',
      withdrawaddress6:'',
      loading:false
    };
  },
  created() {
    // let BODY =document.getElementsByTagName("body")[0]
    // BODY.style.overflowY="hidden"
    let lang = this.getCookie("lang");
    if (lang == "en_US") {
      this.modify = "Modify";
      this.Setup = "Setup";
      this.confirm = "OK";
      this.cancel = "Exit"
    } else if (lang == "zh_TW") {
      this.modify = "修改";
      this.Setup = "設置";
      this.confirm = "確認";
      this.cancel = "取消";
    } else {
      this.modify = "修改";
      this.Setup = "设置";
      this.confirm = "确认";
      this.cancel = "取消";
    }
    var test = window.location.href;
    let id = test.substring(test.indexOf("id") + 3, test.indexOf("&"));
    let coin = test.substring(test.indexOf("name") + 5);
    let index = "";
    if (coin == "HPS") {
      index = 0;
    } else if (coin == "ETH") {
      index = 1;
    } else if (coin == "BTC") {
      index = 2;
    }else if(coin == "HSR"){
      index = 3;
    }else if(coin == "HAND"){//21332231231233212132311233333
      index = 4;
    }else if(coin == "HART"){//21332231231233212132311233333
      index = 5;
    }else if(coin == "MOT"){//21332231231233212132311233333
      index = 6;
    }
    this.typeList = id;
    if (id == 0) {
      this.depositChage(index, coin);
    } else if (id == 1) {
      this.changeCoin(index);
    }else if(id==2){
      this.changeCoin1(index)
    }
  },
  mounted(){
    this.loading=true
  },
  computed: {
    fee: {
      get() {
        let that = this;
        let CoinNumber = this.$refs.coinnumber;
        let amount = this.coinbalcaasdas; //输入的金钱
        if (amount == "" || amount == 0) {
          amount = 0;
          return amount;
        }
        let reg = /^\d+\.?(\d{1,4})?$/;
        if (reg.test(amount) == false && amount != "") {
          amount = 0;
          that.coinbalcaasdas = "";
        }
        if (amount == "" || amount == null || amount < 0) amount = 0;
        if (this.presentation == 0) {
          let requiredFee = amount * 0.005; //需要的收费
          let accountBalance = amount - requiredFee; //减去手续费剩下的
          if (requiredFee <= 12) {
            if (amount <= 0) {
              amount = 0;
            } else {
              amount = 12;
            }
          }
          if (requiredFee > 12) {
            amount = amount * 0.005;
          }
        } else if (this.presentation == 1) {
          let requiredFee = amount * 0.005; //需要的收费
          let accountBalance = amount - requiredFee; //减去手续费剩下的
          if (requiredFee <= 0.01) {
            if (amount <= 0) {
              amount = 0;
            } else {
              amount = 0.01;
            }
          }
          if (requiredFee > 0.01) {
            amount = amount * 0.005;
          }
        } else if (this.presentation == 2) {
          let requiredFee = amount * 0.005; //需要的收费
          let accountBalance = amount - requiredFee; //减去手续费剩下的
          if (requiredFee <= 0.001) {
            if (amount <= 0) {
              amount = 0;
            } else {
              amount = 0.001;
            }
          }
          if (requiredFee > 0.001) {
            amount = amount * 0.005;
          }
        } else if (this.presentation == 3) {
          let requiredFee = amount * 0.005; //需要的收费
          let accountBalance = amount - requiredFee; //减去手续费剩下的
          if (requiredFee <= 0.1) {
            if (amount <= 0) {
              amount = 0;
            } else {
              amount = 0.1;
            }
          }
          if (requiredFee > 0.1) {
            amount = amount * 0.005;
          }
        }
        else if (this.presentation == 4) {//21321231321
          let requiredFee = amount * 0.005; //需要的收费
          let accountBalance = amount - requiredFee; //减去手续费剩下的
          if (requiredFee <= 30000) {
            if (amount <= 0) {
              amount = 0;
            } else {
              amount = 30000;
            }
          }
          if (requiredFee > 30000) {
            amount = amount * 0.005;
          }
        } else if (this.presentation == 5) {//21321231321
          let requiredFee = amount * 0.005; //需要的收费
          let accountBalance = amount - requiredFee; //减去手续费剩下的
          if (requiredFee <= 70) {
            if (amount <= 0) {
              amount = 0;
            } else {
              amount = 70;
            }
          }
          if (requiredFee > 70) {
            amount = amount * 0.005;
          }
        } else if (this.presentation == 6) {//21321231321
          let requiredFee = amount * 0.005; //需要的收费
          let accountBalance = amount - requiredFee; //减去手续费剩下的
          if (requiredFee <= 12) {
            if (amount <= 0) {
              amount = 0;
            } else {
              amount = 12;
            }
          }
          if (requiredFee > 12) {
            amount = amount * 0.005;
          }
        }
        return amount;
      }
    },
    fee1: {
      get() {
        let that = this;
        let emaill = this.$refs.Emailll;
        let Transfers = this.$refs.transfer; //转账数量
        let transamount = this.transferAmount; //输入数量
        if (transamount == "" || transamount == 0) {
          transamount = 0;
          return transamount;
        }
        let reg = /^\d+\.?(\d{1,6})?$/;
        if (reg.test(transamount) == false && transamount != "") {
          transamount = 0;
          that.transferAmount = "";
        }
        if (transamount == "" || transamount == null || transamount < 0)
          transamount = 0;
        if (this.presentation1 == 0) {
          if (transamount > 1) {

          }
        } else if (this.presentation1 == 1) {
          if (transamount > 1) {
            
          }
        } else if (this.presentation1 == 2) {
          if (transamount > 1) {

          }
        }else if(this.presentation1 == 3){
          
        }
        return transamount;
      }
    }
  },
  methods: {
    Promptpopup(){//提示弹窗
      let lang = this.getCookie("lang");
      var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
      document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
      var b='<div class="maskLayer"></div>'
      document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
      document.getElementsByClassName("closeinfo")[0].onclick=function(){
          var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
          var d=document.getElementsByClassName('errorMessage')[0] //移除元素
          document.querySelector('.transactions').removeChild(c)
          document.querySelector('.transactions').removeChild(d)
      }
      if (lang == "en_US") {
        document.getElementsByClassName('errorMessageTop')[0].innerHTML="respected user"
        document.getElementsByClassName('errorMessageBottom')[0].innerHTML="As the reload wallet is undergoing upgrade and expansion, each recharge is currently subject to manual review. Please contact online customer service after recharge to provide user ID, transaction hash, we will review for you as soon as possible. Please be forgiven for inconvenience."
      } else if (lang == "zh_TW") {
        document.getElementsByClassName('errorMessageTop')[0].innerHTML="尊敬的用戶"
        document.getElementsByClassName('errorMessageBottom')[0].innerHTML="因充值錢包正在進行升級擴容，目前每筆充值都需進行人工審核。請您充值後聯繫在線客服，提供用戶ID、交易哈希值，我們將盡快為你審核。帶來不便敬請諒解。"
      } else {
        document.getElementsByClassName('errorMessageTop')[0].innerHTML="尊敬的用户"
        document.getElementsByClassName('errorMessageBottom')[0].innerHTML="因充值钱包正在进行升级扩容，目前每笔充值都需进行人工审核。请您充值后联系在线客服，提供用户ID、交易哈希值，我们将尽快为你审核。带来不便敬请谅解。"
      }
  },
    x15:function(t){
			t.q = false;
			t.ctx.globalAlpha = 1;
			t.ctx.fillStyle = t.c;
			t.ctx.clearRect(0,0,t.w,t.h);
			t.z+=Math.PI/60;
			if(t.f){
				t.a[0].y=t.h/2+Math.cos(t.z)*t.h/2;
			}else{
				t.a[0].y=t.h;
			}
			t.ctx.fillRect(t.a[0].x,t.a[0].y,t.a[0].w,t.a[0].h);
			if(t.a[0].y < t.h){
				t.q = true;
			}
			for(var i = t.a.length-1;i>0;i--){
				t.a[i].y = t.a[i-1].y;
				t.ctx.fillRect(t.a[i].x,t.a[i].y,t.a[i].w,t.a[i].h);
				if(t.a[i].y < t.h){
					t.q = true;
				}
			}
			if(t.f || t.q){
				requestAnimationFrame(function(){
					t.x15(t);
				});
			}else{
				t.ctx.clearRect(0,0,t.w,t.h);
          t.d = false;
			}
		},
    stcAdress(k,index,item) {
      //设置地址方法
      this.changeaddress = k;
      let lang = this.getCookie("lang");
      let coinValue = document.getElementsByClassName("adressValue" + index)[0].value;
      let coinEle = document.getElementsByClassName("adressValue" + index)[0];
      if(this.changeaddress==true){
        coinEle.disabled=false;
      }else{
        coinEle.disabled=true;
      }
      if(this.changeaddress==false && item!=null){
        if (item == "HPS" || item == "ETH" || item == 'HAND' || item == 'HART' || item == 'MOT') {
          let reg = /^0x[A-Za-z0-9]{40}$/;
          if (!reg.test(coinValue)) {
            var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
            var b='<div class="maskLayer"></div>'
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
            document.getElementsByClassName("closeinfo")[0].onclick=function(){
                var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
                var d=document.getElementsByClassName('errorMessage')[0] //移除元素
                document.querySelector('.transactions').removeChild(c)
                document.querySelector('.transactions').removeChild(d)
            }
            if (lang == "en_US") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="Address Error"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Your withdrawal address is incorrect. Please input again."
            } else if (lang == "zh_TW") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="地址錯誤"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的提現地址设置有誤，請重新輸入"
            } else {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="地址错误"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的提现地址输入有误，请重新输入"
            }
            return;
          }
        }else if (item == "BTC") {
          let reg = /^[A-Za-z0-9]{26,34}$/;
          if (!reg.test(coinValue)) {
            var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
            var b='<div class="maskLayer"></div>'
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
            document.getElementsByClassName("closeinfo")[0].onclick=function(){
                var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
                var d=document.getElementsByClassName('errorMessage')[0] //移除元素
                document.querySelector('.transactions').removeChild(c)
                document.querySelector('.transactions').removeChild(d)
            }
            if (lang == "en_US") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="Address Error"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Your withdrawal address is incorrect. Please input again."
            } else if (lang == "zh_TW") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="地址錯誤"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的提現地址设置有誤，請重新輸入"
            } else {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="地址错误"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的提现地址输入有误，请重新输入"
            }
            return;
          }
        }else if(item == 'HSR'){
          let reg = /^[A-Za-z0-9]{34}$/;
          if (!reg.test(coinValue)) {
            var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
            var b='<div class="maskLayer"></div>'
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
            document.getElementsByClassName("closeinfo")[0].onclick=function(){
                var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
                var d=document.getElementsByClassName('errorMessage')[0] //移除元素
                document.querySelector('.transactions').removeChild(c)
                document.querySelector('.transactions').removeChild(d)
            }
            if (lang == "en_US") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="Address Error"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Your withdrawal address is incorrect. Please input again."
            } else if (lang == "zh_TW") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="地址錯誤"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的提現地址设置有誤，請重新輸入"
            } else {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="地址错误"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的提现地址输入有误，请重新输入"
            }
            return;
          }
        }
        // HSR
        let params = {
          // userId: localStorage.getItem('ID'),
          coin: item,
          address: coinValue
        };
        axios.post("/adress/coin/withdrawAddress", params).then(res => {
          if (res.data.code == 200) {
            if(index==0){
              this.withdrawaddress0 = coinValue
            }else if(index==1){
              this.withdrawaddress1 = coinValue
            }else if(index==2){
              this.withdrawaddress2 = coinValue
            }else if(index==3){
              this.withdrawaddress3 = coinValue
            }
            else if(index==4){//123123132132
              this.withdrawaddress4 = coinValue
            }
            else if(index==5){//123123132132
              this.withdrawaddress5 = coinValue
            }
            else if(index==6){//123123132132
              this.withdrawaddress6 = coinValue
            }
            if (lang == "en_US") {
              this.Setup = "Modify";
            } else if (lang == "zh_TW") {
              this.Setup = "修改";
            } else {
              this.Setup = "修改";
            }
            var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
            var b='<div class="maskLayer"></div>'
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
            document.getElementsByClassName("closeinfo")[0].onclick=function(){
                var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
                var d=document.getElementsByClassName('errorMessage')[0] //移除元素
                document.querySelector('.transactions').removeChild(c)
                document.querySelector('.transactions').removeChild(d)
            }
            if (lang == "en_US") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="Modify Success"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Your withdrawal address has been modified successfully."
            } else if (lang == "zh_TW") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="設置成功"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的提現地址設置成功"
            } else {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="设置成功"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的提现地址设置成功"
            }
          }
        })
      }
    },
    changeCoin(index) {
      //切换提现功能
      this.presentation = index;
      this.coinbalcaasdas = "";
      this.changeaddress = 0;
    },
    getCookie(cookiename) {
      //获取cookie
      var arr,
        reg = new RegExp("(^| )" + cookiename + "=([^;]*)(;|$)");
      if ((arr = document.cookie.match(reg))) {
        return unescape(arr[2]);
      } else {
        return null;
      }
    },
    depositChage(index, coin) {
      //切换充值功能
      this.coinAdress0 = "0x8E7FE6dB2b28B56fD9663094495452aF4eE50f6F";
      let userid = window.localStorage.getItem('ID')
      jQuery("#qrcode" + index).empty();
      if(document.getElementsByTagName('canvas')[0]){
        $("canvas").empty()
      }
      this.despositadress = index;
      let params = {
        coin: coin
      };
      axios.post("/adress/coin/depositAddress", params).then(res => {
        this.coinAdress = res.data.data;
        // if(userid==1007){
          this.coinAdress0=this.coinAdress
        // }

      if (coin===this.HPS) {
        // this.Promptpopup()
        jQuery("#qrcode" + index).qrcode({ 
          width: 162,
          height: 162,
          text: this.coinAdress
      });
      }else if (coin===this.ETH) {
        // this.Promptpopup()
          jQuery("#qrcode" + index).qrcode({ 
            width: 162,
            height: 162,
            text: this.coinAdress
        });
      }else if (coin===this.BTC) {
        jQuery("#qrcode" + index).qrcode({
          width: 162,
          height: 162,
          text: this.coinAdress
        });
      }else if (coin===this.HSR) {
        jQuery("#qrcode" + index).qrcode({
          width: 162,
          height: 162,
          text: this.coinAdress
        });
      }else if (coin===this.HAND) {
        // this.Promptpopup()
          jQuery("#qrcode" + index).qrcode({ 
            width: 162,
            height: 162,
            text: this.coinAdress
        });
      } else if (coin===this.HART) {
        // this.Promptpopup()
          jQuery("#qrcode" + index).qrcode({ 
            width: 162,
            height: 162,
            text: this.coinAdress
        });
      } else if (coin===this.MOT) {
        // this.Promptpopup()
          jQuery("#qrcode" + index).qrcode({ 
            width: 162,
            height: 162,
            text: this.coinAdress
        });
      } else {
        jQuery("#qrcode" + index).empty();
      }
    });
      // this.coinAdress = "";
      // jQuery("#qrcode" + index).empty();
      // if(document.getElementsByTagName('canvas')[0]){
      //   $("canvas").empty()
      // }
      // this.despositadress = index;
      // let params = {
      //   userId: 32,
      //   coin: coin
      // };
      // axios.post("/adress/coin/depositAddress", params).then(res => {
      //   this.coinAdress = res.data.data;
      //   if (res.data.data) {
      //     jQuery("#qrcode" + index).qrcode({
      //       width: 162,
      //       height: 162,
      //       text: this.coinAdress
      //     });
      //   } else {
      //     jQuery("#qrcode" + index).empty();
      //   }
      // });
    },
    cashWidthdraw(index, coin) {
      //提现金额功能
      let lang = this.getCookie("lang");
      let caasdas = this.coinbalcaasdas;
      let blancevalue = document.getElementsByClassName("inpit" + index)[0]
        .value; //币种金额
      let coinblance = this.$refs.coinnumber.value;
      let coinValue = document.getElementsByClassName("adressValue" + index)[0]
        .value;
        if (coin == "HPS" || coin == "ETH" || coin == "HAND" || coin == "HART" || coin == "MOT") {//123123132132132121
          let reg = /^0x[A-Za-z0-9]{40}$/;
          if (!reg.test(coinValue)) {
            var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
            var b='<div class="maskLayer"></div>'
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
            document.getElementsByClassName("closeinfo")[0].onclick=function(){
                var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
                var d=document.getElementsByClassName('errorMessage')[0] //移除元素
                document.querySelector('.transactions').removeChild(c)
                document.querySelector('.transactions').removeChild(d)
            }
            if (lang == "en_US") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="Address Error"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Your withdrawal address is incorrect. Please input again."
            } else if (lang == "zh_TW") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="地址錯誤"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的提現地址设置有誤，請重新輸入"
            } else {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="地址错误"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的提现地址输入有误，请重新输入"
            }
            return;
          }
        }
        if (coin == "BTC") {
          let reg = /^[A-Za-z0-9]{26,34}$/;
          if (!reg.test(coinValue)) {
            var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
            var b='<div class="maskLayer"></div>'
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
            document.getElementsByClassName("closeinfo")[0].onclick=function(){
                var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
                var d=document.getElementsByClassName('errorMessage')[0] //移除元素
                document.querySelector('.transactions').removeChild(c)
                document.querySelector('.transactions').removeChild(d)
            }
            if (lang == "en_US") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="Address Error"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Your withdrawal address is incorrect. Please input again."
            } else if (lang == "zh_TW") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="地址錯誤"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的提現地址设置有誤，請重新輸入"
            } else {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="地址错误"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的提现地址输入有误，请重新输入"
            }
            return;
          }
        }
        if (coin == "HSR") {
          let reg = /^[A-Za-z0-9]{30,34}$/;
          if (!reg.test(coinValue)) {
            var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
            var b='<div class="maskLayer"></div>'
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
            document.getElementsByClassName("closeinfo")[0].onclick=function(){
                var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
                var d=document.getElementsByClassName('errorMessage')[0] //移除元素
                document.querySelector('.transactions').removeChild(c)
                document.querySelector('.transactions').removeChild(d)
            }
            if (lang == "en_US") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="Address Error"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Your withdrawal address is incorrect. Please input again."
            } else if (lang == "zh_TW") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="地址錯誤"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的提現地址设置有誤，請重新輸入"
            } else {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="地址错误"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的提现地址输入有误，请重新输入"
            }
            return;
          }
        }
      let params = {
        coin: coin,
        a: coinblance,
        addr: coinValue
      };
      if (+caasdas > +blancevalue) {
        var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
            var b='<div class="maskLayer"></div>'
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
            document.getElementsByClassName("closeinfo")[0].onclick=function(){
                var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
                var d=document.getElementsByClassName('errorMessage')[0] //移除元素
                document.querySelector('.transactions').removeChild(c)
                document.querySelector('.transactions').removeChild(d)
          }
        if (lang == "en_US") {
          document.getElementsByClassName('errorMessageTop')[0].innerHTML="Incorrect Amount"
          document.getElementsByClassName('errorMessageBottom')[0].innerHTML="You cannot enter the amount larger than the account balance."
        } else if (lang == "zh_TW") {
          document.getElementsByClassName('errorMessageTop')[0].innerHTML="金額錯誤"
          document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您输入金额不能大于账户余额"
        } else {
          document.getElementsByClassName('errorMessageTop')[0].innerHTML="金额错误"
          document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您输入金额不能大于账户余额"
        }
        return;
      }else if( caasdas=='' || caasdas==0 ){
        var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
        document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
        var b='<div class="maskLayer"></div>'
        document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
        document.getElementsByClassName("closeinfo")[0].onclick=function(){
            var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
            var d=document.getElementsByClassName('errorMessage')[0] //移除元素
            document.querySelector('.transactions').removeChild(c)
            document.querySelector('.transactions').removeChild(d)
       }
        if (lang == "en_US") {
          document.getElementsByClassName('errorMessageTop')[0].innerHTML="Incorrect Amount"
          document.getElementsByClassName('errorMessageBottom')[0].innerHTML="The amount of input can not be empty or zero."
        } else if (lang == "zh_TW") {
          document.getElementsByClassName('errorMessageTop')[0].innerHTML="金額錯誤"
          document.getElementsByClassName('errorMessageBottom')[0].innerHTML="輸入金額不能為空或為零。"
        } else {
          document.getElementsByClassName('errorMessageTop')[0].innerHTML="金额错误"
          document.getElementsByClassName('errorMessageBottom')[0].innerHTML="输入金额不能为空或为零。"
        }
        return;
      }else{
        axios.post("/adress/coin/withdraw/", params).then(res => {
          this.Prohibited = true;
          if (res.data.code == 200) {
            this.Prohibited = false;
            var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
            var b='<div class="maskLayer"></div>'
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
            document.getElementsByClassName("closeinfo")[0].onclick=function(){
                var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
                var d=document.getElementsByClassName('errorMessage')[0] //移除元素
                document.querySelector('.transactions').removeChild(c)
                document.querySelector('.transactions').removeChild(d)
           }
            if (lang == "en_US") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="Successful Application"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Your application has been successful."
            } else if (lang == "zh_TW") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="申請成功"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的提現申請已成功。"
            } else {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="申请成功"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的提现申请已成功。"
            }
            location.reload()
          }else if (res.data.code=-10011){
            this.Prohibited = false;
            var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
            var b='<div class="maskLayer"></div>'
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
            document.getElementsByClassName("closeinfo")[0].onclick=function(){
                var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
                var d=document.getElementsByClassName('errorMessage')[0] //移除元素
                document.querySelector('.transactions').removeChild(c)
                document.querySelector('.transactions').removeChild(d)
           }
            if (lang == "en_US") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="Insufficient fee"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Your fee is insufficient."
            } else if (lang == "zh_TW") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="手續費不足"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的手續費不足。"
            } else {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="手续费不足"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的手续费不足。"
            }
        }
        })
      }
    },
    closeinfo(){
       document.getElementsByClassName('maskLayer')[0].style.display="none"
       document.getElementsByClassName('errorMessage')[0].style.display="none"
       this.theuser="";
       this.information=""
       let BODY =document.getElementsByTagName("body")[0]
       BODY.style.overflowY=""
    },
    typlelist() {
      this.typeList = 0;
    },
    typlelistone() {
      this.typeList = 1;
    },
    typlelisttwo() {
      this.typeList = 2;
    },
    changeCoin1(index, coin) {
      //转账
      this.presentation1 = index;
      this.transferAmount = 0;
      this.Requestuser = null;
      this.emaill = "";
      let params = {
        coin: coin
      };
      axios.post("/adress/coin/depositAddress", params).then(res => {
        this.coinAdress = res.data.data;
      });
    },
    Requestuserinformation() {
      //邮箱请求用户信息
      let that = this;
      let Email = this.$refs.Emailll.value;
      if (Email == "") {
      } else {
        let params = {
          email: Email
        };
        axios.post("/user/public", params).then(res => {
          if (res.data.code == 200) {
            if (res.data.data) {
              this.TransferuserID = res.data.data.id;
              that.Requestus = res.data.data.nickname;
              this.Requestuser = that.Requestus;
            }
          }
        })
      }
    },
    // typeListone() {
    //   this.typeList = 0;
    //   this.depositChage(0, "HPS");
    // },
    // typeListtwo() {
    //   this.typeList = 1;
    //   this.changeCoin(0);
    // },
    typeListone() {
      this.typeList = 0;
      this.depositChage(0, "HPS");
    },
    typeListtwo() {
      this.typeList = 1;
      this.changeCoin(0);
    },
    typeListthress() {
      this.typeList = 0;
    },
    TransferApplication(index,coin) {//转账
      let lang = this.getCookie("lang");
      let regValid = (/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/)
      let that = this;
      let emaill = this.$refs.Emailll.value;
      let Numb = this.$refs.transfer.value;
      let ID = this.TransferuserID;
      let blancevalue = document.getElementsByClassName('inpit' + index)[0].value //币种金额
      let UID = this.locaId = JSON.parse(window.localStorage.getItem('ID'))//用户ID
      if (emaill == "") {
        var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
        document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
        var b='<div class="maskLayer"></div>'
        document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
        document.getElementsByClassName("closeinfo")[0].onclick=function(){
            var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
            var d=document.getElementsByClassName('errorMessage')[0] //移除元素
            document.querySelector('.transactions').removeChild(c)
            document.querySelector('.transactions').removeChild(d)
       }
        if (lang == "en_US") {
          document.getElementsByClassName('errorMessageTop')[0].innerHTML="Email is Empty"
          document.getElementsByClassName('errorMessageBottom')[0].innerHTML="The mailbox you transferred cannot be empty."
        } else if (lang == "zh_TW") {
          document.getElementsByClassName('errorMessageTop')[0].innerHTML="郵箱為空"
          document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您轉賬的郵箱不能為空。"
        } else {
          document.getElementsByClassName('errorMessageTop')[0].innerHTML="邮箱为空"
          document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您转账的邮箱不能为空。"
        }
        this.Requestuser = "";
        return;
      }else if (!regValid.test(emaill)) {
        var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
        document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
        var b='<div class="maskLayer"></div>'
        document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
        document.getElementsByClassName("closeinfo")[0].onclick=function(){
            var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
            var d=document.getElementsByClassName('errorMessage')[0] //移除元素
            document.querySelector('.transactions').removeChild(c)
            document.querySelector('.transactions').removeChild(d)
       }
        if (lang == "en_US") {
          document.getElementsByClassName('errorMessageTop')[0].innerHTML="Incorrect E-mail"
          document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Please enter the correct email address."
        } else if (lang == "zh_TW") {
          document.getElementsByClassName('errorMessageTop')[0].innerHTML="郵箱不正確"
          document.getElementsByClassName('errorMessageBottom')[0].innerHTML="請您輸入正確的郵箱地址"
        } else {
          document.getElementsByClassName('errorMessageTop')[0].innerHTML="邮箱不正确"
          document.getElementsByClassName('errorMessageBottom')[0].innerHTML="请您输入正确的邮箱地址"
        }
        this.emaill = "";
        this.Requestuser = "";
        return
      }
      if (coin === this.HPS) {
        if (Numb < 1) {
          var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
        document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
        var b='<div class="maskLayer"></div>'
        document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
        document.getElementsByClassName("closeinfo")[0].onclick=function(){
            var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
            var d=document.getElementsByClassName('errorMessage')[0] //移除元素
            document.querySelector('.transactions').removeChild(c)
            document.querySelector('.transactions').removeChild(d)
       }
       document.getElementsByClassName('errorMessageTop')[0].innerHTML="转账失败"
       document.getElementsByClassName('errorMessageBottom')[0].innerHTML="HPS最小转账为3"
          if (lang == "en_US") {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="Transfer Failed"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="The minimum HPS transfer is 1."
          } else if (lang == "zh_TW") {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="轉賬失敗"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="HPS最小轉賬為1。"
          } else {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="转账失败"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="HPS最小转账为1。"
          }
          this.transferAmount = 0;
          return;
        } else {
          if (blancevalue - Numb < 0) {
            var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
            var b='<div class="maskLayer"></div>'
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
            document.getElementsByClassName("closeinfo")[0].onclick=function(){
                var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
                var d=document.getElementsByClassName('errorMessage')[0] //移除元素
                document.querySelector('.transactions').removeChild(c)
                document.querySelector('.transactions').removeChild(d)
           }
            if (lang == "en_US") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="Transfer Failed"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Your balance is insufficient and the transfer failed."
            } else if (lang == "zh_TW") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="轉賬失敗"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的餘額不足，轉賬失敗。"
            } else {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="转账失败"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的余额不足，转账失败。"
            }
            this.transferAmount = 0;
            return;
          }
        }
      } else if (coin == this.ETH) {
        if (Numb < 0.1) {
          var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
          document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
          var b='<div class="maskLayer"></div>'
          document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
          document.getElementsByClassName("closeinfo")[0].onclick=function(){
              var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
              var d=document.getElementsByClassName('errorMessage')[0] //移除元素
              document.querySelector('.transactions').removeChild(c)
              document.querySelector('.transactions').removeChild(d)
         }
          if (lang == "en_US") {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="Transfer Failed"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="The minimum ETH transfer is 0.1."
          } else if (lang == "zh_TW") {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="轉賬失敗"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="ETH最小轉賬為0.1。"
          } else {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="转账失败"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="ETH最小转账为0.1。"
          }
          this.transferAmount = 0;
          return;
        } else {
          if (blancevalue - Numb < 0) {
            var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
            var b='<div class="maskLayer"></div>'
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
            document.getElementsByClassName("closeinfo")[0].onclick=function(){
                var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
                var d=document.getElementsByClassName('errorMessage')[0] //移除元素
                document.querySelector('.transactions').removeChild(c)
                document.querySelector('.transactions').removeChild(d)
           }
            if (lang == "en_US") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="Transfer Failed"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Your balance is insufficient and the transfer failed."
            } else if (lang == "zh_TW") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="轉賬失敗"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的餘額不足，轉賬失敗。"
            } else {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="转账失败"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的余额不足，转账失败。"
            }
            this.transferAmount = 0;
            return;
          }
        }
      } else if (coin == this.BTC) {
        if (Numb < 0.001) {
          var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
            var b='<div class="maskLayer"></div>'
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
            document.getElementsByClassName("closeinfo")[0].onclick=function(){
                var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
                var d=document.getElementsByClassName('errorMessage')[0] //移除元素
                document.querySelector('.transactions').removeChild(c)
                document.querySelector('.transactions').removeChild(d)
           }
          if (lang == "en_US") {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="Transfer Failed"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="The minimum BTC transfer is 0.001."
          } else if (lang == "zh_TW") {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="轉賬失敗"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="BTC最小轉賬為0.001。"
          } else {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="转账失败"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="BTC最小转账为0.001。"
          }
          this.transferAmount = 0;
          return;
        } else {
          if (blancevalue - Numb < 0) {
            var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
            var b='<div class="maskLayer"></div>'
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
            document.getElementsByClassName("closeinfo")[0].onclick=function(){
                var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
                var d=document.getElementsByClassName('errorMessage')[0] //移除元素
                document.querySelector('.transactions').removeChild(c)
                document.querySelector('.transactions').removeChild(d)
           }
            if (lang == "en_US") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="Transfer Failed"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Your balance is insufficient and the transfer failed."
            } else if (lang == "zh_TW") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="轉賬失敗"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的餘額不足，轉賬失敗。"
            } else {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="转账失败"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的余额不足，转账失败。"
            }
            this.transferAmount = 0;
            return;
          }
        }
      } else if (coin == this.HAND) {//123132132132
        if (Numb < 0.001) {
          var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
            var b='<div class="maskLayer"></div>'
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
            document.getElementsByClassName("closeinfo")[0].onclick=function(){
                var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
                var d=document.getElementsByClassName('errorMessage')[0] //移除元素
                document.querySelector('.transactions').removeChild(c)
                document.querySelector('.transactions').removeChild(d)
           }
          if (lang == "en_US") {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="Transfer Failed"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="The minimum HAND transfer is 0.001."
          } else if (lang == "zh_TW") {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="轉賬失敗"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="HAND最小轉賬為0.001。"
          } else {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="转账失败"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="HAND最小转账为0.001。"
          }
          this.transferAmount = 0;
          return;
        } else {
          if (blancevalue - Numb < 0) {
            var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
            var b='<div class="maskLayer"></div>'
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
            document.getElementsByClassName("closeinfo")[0].onclick=function(){
                var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
                var d=document.getElementsByClassName('errorMessage')[0] //移除元素
                document.querySelector('.transactions').removeChild(c)
                document.querySelector('.transactions').removeChild(d)
           }
            if (lang == "en_US") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="Transfer Failed"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Your balance is insufficient and the transfer failed."
            } else if (lang == "zh_TW") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="轉賬失敗"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的餘額不足，轉賬失敗。"
            } else {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="转账失败"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的余额不足，转账失败。"
            }
            this.transferAmount = 0;
            return;
          }
        }
      }else if (coin == this.HART) {//123132132132
        if (Numb < 0.001) {
          var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
          document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
          var b='<div class="maskLayer"></div>'
          document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
          document.getElementsByClassName("closeinfo")[0].onclick=function(){
              var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
              var d=document.getElementsByClassName('errorMessage')[0] //移除元素
              document.querySelector('.transactions').removeChild(c)
              document.querySelector('.transactions').removeChild(d)
         }
          if (lang == "en_US") {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="Transfer Failed"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="The minimum HART transfer is 0.001."
          } else if (lang == "zh_TW") {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="轉賬失敗"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="HART最小轉賬為0.001。"
          } else {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="转账失败"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="HART最小转账为0.001。"
          }
          this.transferAmount = 0;
          return;
        } else {
          if (blancevalue - Numb < 0) {
            var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
            var b='<div class="maskLayer"></div>'
            document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
            document.getElementsByClassName("closeinfo")[0].onclick=function(){
                var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
                var d=document.getElementsByClassName('errorMessage')[0] //移除元素
                document.querySelector('.transactions').removeChild(c)
                document.querySelector('.transactions').removeChild(d)
           }
            if (lang == "en_US") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="Transfer Failed"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Your balance is insufficient and the transfer failed."
            } else if (lang == "zh_TW") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="轉賬失敗"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的餘額不足，轉賬失敗。"
            } else {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="转账失败"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的余额不足，转账失败。"
            }
            this.transferAmount = 0;
            return;
          }
        }
      }else if (coin == this.MOT) {//123132132132
        if (Numb < 0.001) {
          var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
          document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
          var b='<div class="maskLayer"></div>'
          document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
          document.getElementsByClassName("closeinfo")[0].onclick=function(){
              var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
              var d=document.getElementsByClassName('errorMessage')[0] //移除元素
              document.querySelector('.transactions').removeChild(c)
              document.querySelector('.transactions').removeChild(d)
         }
          if (lang == "en_US") {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="Transfer Failed"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="The minimum MOT transfer is 0.001."
          } else if (lang == "zh_TW") {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="轉賬失敗"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="MOT最小轉賬為0.001。"
          } else {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="转账失败"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="MOT最小转账为0.001。"
          }
          this.transferAmount = 0;
          return;
        } else {
          if (blancevalue - Numb < 0) {
            var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
          document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
          var b='<div class="maskLayer"></div>'
          document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
          document.getElementsByClassName("closeinfo")[0].onclick=function(){
              var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
              var d=document.getElementsByClassName('errorMessage')[0] //移除元素
              document.querySelector('.transactions').removeChild(c)
              document.querySelector('.transactions').removeChild(d)
         }
            if (lang == "en_US") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="Transfer Failed"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Your balance is insufficient and the transfer failed."
            } else if (lang == "zh_TW") {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="轉賬失敗"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的餘額不足，轉賬失敗。"
            } else {
              document.getElementsByClassName('errorMessageTop')[0].innerHTML="转账失败"
              document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的余额不足，转账失败。"
            }
            this.transferAmount = 0;
            return;
          }
        }
      }
      let params = {
        coin: coin,
        userId: parseInt(UID) ,
        a: parseFloat(Numb),
        u: parseInt(ID),
        e: emaill,
      };
      axios.post("/adress/coin/transfer", params).then(res => {
        if (res.data.code == 200) {
          var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
          document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
          var b='<div class="maskLayer"></div>'
          document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
          document.getElementsByClassName("closeinfo")[0].onclick=function(){
              var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
              var d=document.getElementsByClassName('errorMessage')[0] //移除元素
              document.querySelector('.transactions').removeChild(c)
              document.querySelector('.transactions').removeChild(d)
         }
          if (lang == "en_US") {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="Successful"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Your currency has been successfully transferred."
          } else if (lang == "zh_TW") {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="轉賬成功"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的幣已經成功轉出。"
          } else {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="转账成功"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的币已经成功转出。"
          }
          this.emaill = "";
          this.Requestuser = "";
          this.transferAmount = 0;
          return;
        }else{
          var a=  '<div class="errorMessage"><div class="errorMessageTop" v-html="theuser"></div> <div class="errorMessageBottom" v-html="information"></div><img src="/image/close.png" alt="" class="closeinfo"></div>' 
          document.querySelector('.transactions').insertAdjacentHTML('afterBegin',a)
          var b='<div class="maskLayer"></div>'
          document.querySelector('.transactions').insertAdjacentHTML('afterBegin',b)
          document.getElementsByClassName("closeinfo")[0].onclick=function(){
              var c= document.getElementsByClassName('maskLayer')[0]  //移除元素
              var d=document.getElementsByClassName('errorMessage')[0] //移除元素
              document.querySelector('.transactions').removeChild(c)
              document.querySelector('.transactions').removeChild(d)
         }
          if (lang == "en_US") {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="Transfer Failed"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="Your transfer email does not exist."
          } else if (lang == "zh_TW") {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="轉賬失敗"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的轉賬郵箱不存在。"
          } else {
            document.getElementsByClassName('errorMessageTop')[0].innerHTML="转账失败"
            document.getElementsByClassName('errorMessageBottom')[0].innerHTML="您的转账邮箱不存在。"
          }
          this.emaill = "";
          this.Requestuser = "";
          this.transferAmount = 0;
          return;
        }
      });
    }
  }
});
